<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" errorPage="exception-page.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@page import="java.util.List" import="java.util.ArrayList"%><html>
<head>
<title>Insert title here</title>
</head>
<%@ taglib prefix="mine" uri="http://sos.net/MyTags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="my" uri="http://sos.net/MyTags" %>

<body>
	<c:catch var="myEx"> 
		<% int i = 1/0; %>
	</c:catch>
	<span>#${myEx}#</span>
	<jsp:useBean id="myBean" class="net.sasuke.firstapp.NameBean"></jsp:useBean>	
	<jsp:include page="header.jsp">
		<jsp:param value="1" name="roundNumber"/>
	</jsp:include>
	<c:import url="header.jsp">
		<c:param name="roundNumber">2</c:param>
	</c:import>
	<%
		List list = new ArrayList();
		list.add("1");
		request.setAttribute("listIdx", 1);
		request.setAttribute("list", list);
	%>
	<jsp:useBean id="myName" class="net.sasuke.firstapp.NameBean" />
	<jsp:setProperty name="myName" property="name" />
	<jsp:getProperty property="name" name="myName"/>
	<%
	out.println("<br />page: " + page.getClass());
	out.println("<br />page context: " + pageContext.getClass());
	out.println("<br />config: " + config.getClass());
	out.println("<br />request: " + request.getClass());
	out.println("<br />response: " + response.getClass());
	out.println("<br />out: " + out.getClass());
	out.println("<br />session: " + session.getClass());
	out.println("<br />application: " + application.getClass());
	out.println("<br />CTX variable: " + application.getAttribute("DATABASE"));
	out.println("<br /><br /><br />request A: " + request.getAttribute("A"));
	out.println("<br /><a href='" + response.encodeURL("jsp/first.jsp") + "'>Hi from URL encoded URL</a><br/>");
	%>
	<a href='<c:url value="jsp/first.jsp" />'>Hi from c:url encoded url</a><br />
	${mine:rollIt(6)}
	<br /><br />List attributes<br />
	<c:out value="Value Count Index"></c:out>
	<c:forEach var="i" begin="5" end="10" step="2" varStatus="status">
		<br /><c:out value="${i} === ${status.count} === ${status.index}"/>
	</c:forEach>
	<c:if test="${1 == 1}" var="myBool" scope="request">Hello ${myBool}</c:if>
	<c:choose>
		<c:when test="${1 == 1}">TRUTH</c:when>
		<c:otherwise>WTH</c:otherwise>
	</c:choose>
	<c:set target="${requestScope}" property="xyz" var="XXX" value="TRE" />
	
	<c:set var="myname" value="SANJAY" />
	<my:cookie user="${myname}"></my:cookie>
</body>
</html>